using AutoMapper;
using UwinEducation.Application.Dtos;
using UwinEducation.Domain.Entities;

namespace UwinEducation.Application.Mappings
{
    public class TeacherVacationProfile : Profile
    {
        public TeacherVacationProfile()
        {
            CreateMap<TeacherVacation, TeacherVacationDto>()
                .ForMember(dest => dest.Teacher, opt => opt.MapFrom(src => src.Teacher));

            CreateMap<CreateTeacherVacationDto, TeacherVacation>();
            CreateMap<UpdateTeacherVacationDto, TeacherVacation>()
                .ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null));
        }
    }
} 